<page-header [title]="'资产列表'">
  <nz-card [nzBordered]="false" class>
    <form nz-form class="search__form" action="search">
      <div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
        <div nz-col nzMd="8" nzSm="24">
          <nz-form-item>
            <nz-form-label nzFor="Name">资产名称</nz-form-label>
            <nz-form-control>
              <input nz-input [(ngModel)]="q.Name" name="Name" #DictionaryGroupName placeholder="请输入" />
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="24" [class.text-right]="expandForm" style="text-align: right">
          <button nz-button type="submit" [nzType]="'primary'" (click)="getData()">搜索</button>
          <!--<button nz-button type="submit" (click)="getData()" [nzType]="'primary'" [nzLoading]="loading">查询</button>-->
          <button nz-button type="reset" (click)="reset()" class="mx-sm">重置</button>
        </div>
      </div>
    </form>

    <button nz-button [nzType]="'primary'" (click)="openComponent('00000000-0000-0000-0000-000000000000')" acl [acl-ability]="59">
      <i nz-icon nzType="plus"></i>
      <span>{{ 'button.new' | i18n }}</span>
    </button>
    <!--<button nz-button [nzType]="'primary'" [routerLink]="['/manage/authority/roleform']" [queryParams]="{Id:-1}">
            <i nz-icon nzType="plus"></i>
            <span>{{ 'button.new' | translate }}</span>
          </button>-->

    <st
      #st
      [columns]="columns"
      [data]="url"
      [ps]="q.ps"
      [page]="page"
      [req]="req"
      [res]="res"
      [expandAccordion]="true"
      [expand]="expand"
      (change)="onchange($event)"
    >
    </st>
  </nz-card>

  <ng-template #expand let-item let-index="index" let-column="column">
    <nz-card nzTitle="设备属性最新">
      <nz-table [nzNoResult]="null">
        <thead>
          <tr>
            <td>属性名称</td>
            <td>属性值</td>
            <td>数据侧</td>
            <td>时间</td>
          </tr></thead
        >
        <tbody>
          <tr *ngFor="let _item of ceadl; let i = index; let odd = odd" [ngClass]="_item.class">
            <td>{{ _item.keyName }}</td>
            <td>{{ _item.value }}</td>
            <td>{{ _item.dataSide }}</td>
            <td>{{ _item.dateTime }}</td>
            <td> </td>
          </tr>
        </tbody>
      </nz-table>
    </nz-card>

    <nz-card nzTitle="遥测数据最新">
      <nz-table [nzNoResult]="null">
        <thead>
          <tr>
            <td>遥测名称</td>
            <td>遥测值</td>
            <td>时间</td>
          </tr></thead
        >
        <tbody>
          <tr *ngFor="let _item of cetdl; let i = index; let odd = odd" [ngClass]="_item.class">
            <td>{{ _item.keyName }}</td>
            <td>{{ _item.value }}</td>
            <td>{{ _item.dateTime }}</td>
          </tr>
        </tbody>
      </nz-table>
    </nz-card>

    <nz-card nzTitle="设备属性">
      <nz-table [nzNoResult]="null">
        <thead>
          <tr>
            <td>属性名称</td>
            <td>属性值</td>
            <td>数据侧</td>
            <td>时间</td>
          </tr></thead
        >
        <tbody>
          <tr *ngFor="let _item of cead; let i = index; let odd = odd" [ngClass]="_item.class">
            <td>{{ _item.keyName }}</td>
            <td>{{ _item.value }}</td>
            <td>{{ _item.dataSide }}</td>
            <td>{{ _item.dateTime }}</td>
            <td> </td>
          </tr>
        </tbody>
      </nz-table>
    </nz-card>

    <nz-card nzTitle="遥测数据">
      <nz-table [nzNoResult]="null">
        <thead>
          <tr>
            <td>遥测名称</td>
            <td>遥测值</td>
            <td>时间</td>
          </tr></thead
        >
        <tbody>
          <tr *ngFor="let _item of cetd; let i = index; let odd = odd" [ngClass]="_item.class">
            <td>{{ _item.keyName }}</td>
            <td>{{ _item.value }}</td>
            <td>{{ _item.dateTime }}</td>
          </tr>
        </tbody>
      </nz-table>
    </nz-card>

    <nz-card nzTitle="其他">
      <nz-table [nzNoResult]="null">
        <thead>
          <tr>
            <td>名称</td>
            <td>值</td>
            <td>时间</td>
          </tr></thead
        >
        <tbody>
          <tr *ngFor="let _item of none; let i = index; let odd = odd" [ngClass]="_item.class">
            <td>{{ _item.keyName }}</td>
            <td>{{ _item.value }}</td>
            <td>{{ _item.dateTime }}</td>
          </tr>
        </tbody>
      </nz-table>
    </nz-card>
  </ng-template>
</page-header>
